package com.framework.common.api;

/**
 * 枚举了一些常用API操作码
 * Created by macro on 2019/4/19.
 */
public enum ResultCode implements IErrorCode {
    //返回值
    SUCCESS(0, "操作成功"),
    FAILED(-1, "操作失败"),
    UNAUTHORIZED(401, "暂未登录"),
    FORBIDDEN(403, "没有相关权限"),

    EXCEPTION(500, "程序异常");

    private int code;
    private String message;

    private ResultCode(int code, String message) {
        this.code = code;
        this.message = message;
    }

    @Override
    public int getCode() {
        return code;
    }

    @Override
    public String getMessage() {
        return message;
    }
}
